2-FACTOR ANOVA: RANDOMIZED BLOCK DESIGN (TI-83/84 Plus Calculators)
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael Lloyd (http://fac.hsu.edu/lloydm/83-84/index.html)
Henderson State University
++++++++++++++++++++++++++++++++++++++++++++++++++++++
HISTORY
November 1997 - original version
June 2001 - slight improvement
August 2015 - update files to .8xp
++++++++++++++++++++++++++++++++++++++++++++++++++++++
EXAMPLE
Suppose there are 3 treatment variables, and 5 blocking 
factors, then matrix [A] would have 3 columns and 5 rows.
For example, 

          [[ 19 25 25 ]
           [ 19 23 23 ]
           [ 18 22 23 ]
           [ 14 21 13 ]
           [ 12 22 14 ]]

For this example, each blocking factor is the day of the
week: Monday through Friday. The treatment variables are three 
different hospitals. When you run the program ANOVA2RB, press
enter to go to the next screen. For the above frequency table,
this program gives (approximately)

Sum of Squares for the Treatment factor = 96.1
Sum of Squares for the BLocking factor = 131.1
Sum of squares for the Error = 46.5
Sum of squares Total = 273.7
degrees of freedom for the Treatment factor = 2
degrees of freedom for the BLocking factor = 4
degrees of freedom for the Error = 8
total degrees of freedom = 14
Mean Square variance for the Treatment factor = 48.1
Mean Square variance for the BLocking factor = 32.8
Mean Square variance for the Error  = 5.8
F value for the Treatment factor = 8.3
Hay's omega squared statistic for treatment factor = .302
Hay's omega squared statistic for BLocking factor = .386

The program then prompts for a significance level. If you
enter .05, then it will give

Treatment factor critical t value = 3.02
Treatment factor Critical Difference = 4.60
Blocking factor citical t value = 3.83
Blocking factor Critical Difference = 7.55

++++++++++++++++++++++++++++++++++++++++++++++++++++++
VARIABLES USED
A = constant
[A] = data
C = constant, MSBl, confidence level
E = SSE
F = MSE
List C = column sums
List R = row sums
K = number of treatments = number of columns
L = SSBl
N = number of blocks = number of rows
R = SSTr
S = significance
T = SST, critical t value
U = MSTr
++++++++++++++++++++++++++++++++++++++++++++++++++++++
PROGRAM LISTING


Disp "DATA IN [A]","GROUPS IN COLS","BLOCKS IN ROWS"
Pause 
dim([A])\->\R:\L\R(2)\->\K:\L\R(1)\->\N
{1}\->\R:{1}\->\C
For(J,1,K)
sum(seq([A](I,J),I,1,N))\->\\L\C(J)
End
For(I,1,N)
sum(seq([A](I,J),J,1,K))\->\\L\R(I)
End
sum(\L\C)\->\T:T\^2\/(KN)\->\C
0
For(I,1,N):For(J,1,K)
Ans+[A](I,J)\^2\
End:End
Ans-C\->\T
sum((\L\C)\^2\)/N-C\->\R
sum((\L\R)\^2\)/K-C\->\L
T-R-L\->\E
Disp "SSTr=",R
Disp "SSBL=",L
Disp "SSE=",E
Pause 
Disp "SST=",T
K-1
Disp "DF Tr=",Ans
R/Ans\->\U:N-1
Disp "DF BL=",Ans
Pause 
L/Ans\->\C:(K-1)(N-1)
Disp "DF ERROR=",Ans
E/Ans\->\F
Disp "DF TOT=",KN-1
Disp "MSTr=",U
Pause 
Disp "MSBL=",C
Disp "MSE=",F
Disp "F Tr=",U/F
Pause 
Disp "F BL=",C/F
Disp "HAY'S W\^2\ Tr=",(R-(K-1)F)/(T+F)
Disp "HAY'S W\^2\ BL=",(L-(N-1)F)/(T+F)
(K-1)(N-1)+1\->\A
Input "SIG=",S
Disp "Tr FACTOR","CRIT ="
1-S/K nCr 2\->\C
TInterval 0,\root\(A),A,C
upper\->\T
Disp T,"CD=",T\root\(2F/N)
Pause 
Disp "BL FACTOR","CRIT ="
1-S/N nCr 2\->\C
TInterval 0,\root\(A),A,C
upper\->\T
Disp T,"CD=",T\root\(2F/K)
DelVar \L\R:DelVar \L\C